package ptij.verifier.test;

import ptolemy.actor.*;
import ptolemy.kernel.*;
import ptolemy.kernel.util.*;
import ptolemy.data.*;
import ptolemy.data.type.*;

public class test2 extends TypedAtomicActor {

   public test2(CompositeEntity container, String Name) throws
           NameDuplicationException, IllegalActionException  {
       super(container, Name);      

       plus = new TypedIOPort(this, "plus", true, false);
       output = new TypedIOPort(this, "output", false, true);
   }

   public TypedIOPort plus;
   public TypedIOPort output;


   public void fire() throws IllegalActionException {
   
       for(int i = 0;i < n;i++) {
          metodo1();          
       }
       
//       for(int i = 0;i < 10 + n;i++) {
       for(int i = 0;i < 10;i++) {
          metodo2();
       }
   
   }
   
   private void metodo1() {
    
       System.out.println("oi");
   
   }
   
   private void metodo2() throws IllegalActionException {
      if(plus.hasToken(0)) {
          output.broadcast(plus.get(0));
      }
      n++;
   }
   
   int n = 0;
	
   
}
